{% extends 'base.html' %}

{% block title %}删除工具 - {{ tool.name }}{% endblock %}

{% block extra_css %}
<style>
:root {
    --primary-color: #00ffff;
    --secondary-color: #ff6b6b;
    --bg-color: #0a0a0a;
    --card-bg: #1a1a1a;
    --text-color: #ffffff;
    --border-color: #333;
    --error-color: #ff6b6b;
}

.delete-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.1);
    border: 1px solid var(--error-color);
    text-align: center;
}

.delete-title {
    color: var(--error-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.delete-warning {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.tool-info {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.tool-name {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tool-description {
    color: #ccc;
    margin-bottom: 1rem;
}

.tool-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #888;
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color), #cc0000);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-left: 1rem;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
    color: white;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.button-group {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .delete-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .tool-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}
</style>
{% endblock %}

{% block content %}
<div class="container mt-4">
    <div class="delete-container">
        <h1 class="delete-title">
            <i class="fas fa-exclamation-triangle"></i>
            删除工具确认
        </h1>
        
        <div class="delete-warning">
            <i class="fas fa-warning"></i>
            <strong>警告：</strong>此操作不可撤销！删除后，工具的所有信息和相关数据都将永久丢失。
        </div>
        
        <div class="tool-info">
            <div class="tool-name">
                <i class="{{ tool.icon }}"></i>
                {{ tool.name }}
            </div>
            <div class="tool-description">
                {{ tool.description|truncatewords:20 }}
            </div>
            <div class="tool-meta">
                <span>
                    <i class="fas fa-user"></i>
                    创建者：{{ tool.author.username }}
                </span>
                <span>
                    <i class="fas fa-calendar"></i>
                    创建时间：{{ tool.created_at|date:"Y-m-d" }}
                </span>
            </div>
        </div>
        
        <p class="text-muted">
            您确定要删除工具 <strong>"{{ tool.name }}"</strong> 吗？
        </p>
        
        <div class="button-group">
            <a href="{% url 'tools:tool_detail' slug=tool.slug %}" class="btn-secondary">
                <i class="fas fa-arrow-left"></i> 取消
            </a>
            
            <form method="post" style="display: inline;">
                {% csrf_token %}
                <button type="submit" class="btn-danger">
                    <i class="fas fa-trash"></i> 确认删除
                </button>
            </form>
        </div>
    </div>
</div>
{% endblock %}